/*------------------------------------------------------------------------------
 * Fortress DS
 * 
 * Copyright (c) 2008 David Panseri
 * distributed under the terms of the GNU General Public License
 -------------------------------------------------------------------------------
 *
 * TextBackground.h
 *
 -----------------------------------------------------------------------------*/

#ifndef _TEXTBACKGROUND_H
#define	_TEXTBACKGROUND_H

// The following values apply to our current demo
#define SCR_WIDTH 32
#define SCR_HEIGHT 24
#define DS_32x32_WIDTH 32

class TextBackground
{
public:
    //constructors
    TextBackground(void);
    TextBackground(u16 height, u16 width, u8* tiles, u16 tileSize, u8* palette, u16 palSize, u16* map, u16 mapSize);
    
    
    //get methods
    u16    getHeight   (void);
    u16    getWidth    (void);
    u8*    getTiles    (void);
    u16    getTileSize (void);
    u8*    getPalette  (void);
    u16    getPalSize  (void);
    u16*   getMap      (void);
    u16    getMapSize  (void);
    
    //set methods
    void    setHeight  (u16 height);
    void    setWidth   (u16 width);
    void    setTiles   (u8* tiles, u16 size);
    void    setPalette (u8* palette, u16 size);
    void    setMap     (u16* map, u16 size);
    
    //copy methods
    void copyTiles(void *pTileRam);
    void copyPalette(void *pPalRam);
    void copyMap(void *pMapRam, u16 x, u16 y);
    void copyMap(void *pMapRam, u16 x, u16 y, u16 xOffset, u16 yOffset);
    
private:
    u16     tileSize;       //map data size
    u16     palSize;       //map data size
    u16     mapSize;       //map data size
    
    u16     height;         //map height in tiles
    u16     width;          //map width in tiles
    
    u8*     pTiles;         //tile data
    u8*     pPalette;       //palette data
    u16*    pMap;           //map data
};

#endif	/* _TEXTBACKGROUND_H */

